﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MinoSoft.sslpDataSetTableAdapters;

namespace MinoSoft
{
    public partial class FrmCajaInicial : Form
    {
        public FrmCajaInicial()
        {
            InitializeComponent();
        }

        private void txtBxCajaInicial_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == Convert.ToChar(Keys.Enter))
            {
                CAJAINICIALTableAdapter cajaInicial = new CAJAINICIALTableAdapter();
                int resultado = cajaInicial.InsertCajaDiaria(DateTime.Now.Date, Convert.ToDecimal(txtBxCajaInicial.Text));

                if (resultado < 0)
                    MessageBox.Show("Error al insertar dato");
                else if (resultado > 0)
                    MessageBox.Show("Monto ingresado exitosamente", "Caja Inicial", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Close();
            }

 
        }
    }
}
